import request from '@/utils/request'

// 查询客户列表
export function listPartner(query) {
  return request({
    url: '/bd/partner/list',
    method: 'get',
    params: query
  })
}

// 查询客户详细
export function getPartner(id) {
  return request({
    url: '/bd/partner/' + id,
    method: 'get'
  })
}

//取得用户归属
export function takePartner(id) {
  return request({
    url: '/bd/partner/take/'+id,
    method: 'get'
  })
}

// 新增客户
export function addPartner(data) {
  return request({
    url: '/bd/partner',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updatePartner(data) {
  return request({
    url: '/bd/partner',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delPartner(id) {
  return request({
    url: '/bd/partner/' + id,
    method: 'delete'
  })
}


// 授权客户
export function PutPrivilegePartner(ids,userIds) {
  return request({
    url: '/bd/partner/' + ids+'/'+userIds,
    method: 'put'
  })
}
